type User={
    id:number;
    name:string;
    username:string;
    email:string;
    status:"ACTIVE"|"INACTIVE"
}

async function getUserById1(id:string,users:User[]){
    const user=await users.find(
        user => user.id===Number(id)
    )
    if(!user){
        throw new Error("用户不存在");
    }
    return user;
}
